home *** CD-ROM | disk | FTP | other *** search
/ PC PowerPlay 58 / pcpp58a.iso / extras / quake 3 source / Q3A_ToolSource.exe / Main / XYWnd.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-01-02  |  5.5 KB  |  199 lines

  1. #if !defined(AFX_XYWND_H__44B4BA04_781B_11D1_B53C_00AA00A410FC__INCLUDED_)
  2. #define AFX_XYWND_H__44B4BA04_781B_11D1_B53C_00AA00A410FC__INCLUDED_
  3.  
  4. #if _MSC_VER >= 1000
  5. #pragma once
  6. #endif // _MSC_VER >= 1000
  7. // XYWnd.h : header file
  8. //
  9.  
  10. /////////////////////////////////////////////////////////////////////////////
  11. // CXYWnd window
  12.  
  13. #include "qe3.h"
  14. #include "CamWnd.h"
  15.  
  16. const int SCALE_X = 0x01;
  17. const int SCALE_Y = 0x02;
  18. const int SCALE_Z = 0x04;
  19.  
  20.  
  21. typedef void (PFNPathCallback)(bool, int);
  22. // as i didn't really encapsulate anything this
  23. // should really be a struct..
  24. class CClipPoint
  25. {
  26. public:
  27.   CClipPoint(){ Reset(); };
  28.   void Reset(){ m_ptClip[0] = m_ptClip[1] = m_ptClip[2] = 0.0; m_bSet = false; m_pVec3 = NULL;};
  29.   bool Set(){ return m_bSet; };
  30.   void Set(bool b) { m_bSet = b; };
  31.   void UpdatePointPtr() { if (m_pVec3) VectorCopy(m_ptClip, *m_pVec3); };
  32.   void SetPointPtr(vec3_t* p) { m_pVec3 = p; };
  33.   vec3_t m_ptClip;      // the 3d point
  34.   vec3_t* m_pVec3;      // optional ptr for 3rd party updates
  35.   CPoint m_ptScreen;    // the onscreen xy point (for mousability)
  36.   bool m_bSet;
  37.   operator vec3_t&() {return m_ptClip;};
  38.   operator vec3_t*() {return &m_ptClip;};
  39. };
  40.  
  41. class CXYWnd : public CWnd
  42. {
  43.   DECLARE_DYNCREATE(CXYWnd);
  44. // Construction
  45. public:
  46.     CXYWnd();
  47.  
  48. // Attributes
  49. public:
  50.  
  51. // Operations
  52. public:
  53.  
  54. // Overrides
  55.     // ClassWizard generated virtual function overrides
  56.     //{{AFX_VIRTUAL(CXYWnd)
  57.     protected:
  58.     virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  59.     //}}AFX_VIRTUAL
  60.  
  61. // Implementation
  62. public:
  63.   bool AreaSelectOK();
  64.   vec3_t& RotateOrigin();
  65.   vec3_t& Rotation();
  66.   void UndoClear();
  67.   bool UndoAvailable();
  68.   void KillPathMode();
  69.   void Undo();
  70.   void UndoCopy();
  71.   void Copy();
  72.   void Paste();
  73.   void Redraw(unsigned int nBits);
  74.   void VectorCopyXY(vec3_t in, vec3_t out);
  75.     void PositionView();
  76.     void FlipClip();
  77.     void SplitClip();
  78.     void Clip();
  79.     vec3_t& GetOrigin();
  80.     void SetOrigin(vec3_t org);        // PGM
  81.     void XY_Init();
  82.   void XY_Overlay();
  83.   void XY_Draw();
  84.   void DrawZIcon();
  85.   void DrawRotateIcon();
  86.   void DrawCameraIcon();
  87.   void XY_DrawBlockGrid();
  88.   void XY_DrawGrid();
  89.   void XY_MouseMoved (int x, int y, int buttons);
  90.   void NewBrushDrag (int x, int y);
  91.   qboolean DragDelta (int x, int y, vec3_t move);
  92.   void XY_MouseUp(int x, int y, int buttons);
  93.   void XY_MouseDown (int x, int y, int buttons);
  94.   void XY_ToGridPoint (int x, int y, vec3_t point);
  95.   void XY_ToPoint (int x, int y, vec3_t point);
  96.   void SnapToPoint (int x, int y, vec3_t point);
  97.   void SetActive(bool b) {m_bActive = b;};
  98.   bool Active() {return m_bActive;};
  99.   void DropClipPoint(UINT nFlags, CPoint point);
  100.  
  101.   bool RogueClipMode();
  102.     bool ClipMode();
  103.     void SetClipMode(bool bMode);
  104.     void RetainClipMode(bool bMode);
  105.  
  106.   bool RotateMode();
  107.   bool SetRotateMode(bool bMode);
  108.   bool ScaleMode();
  109.   void SetScaleMode(bool bMode);
  110.  
  111.   bool PathMode();
  112.   void DropPathPoint(UINT nFlags, CPoint point);
  113.  
  114.   bool PointMode();
  115.   void AddPointPoint(UINT nFlags, vec3_t* pVec);
  116.   void SetPointMode(bool b);
  117.  
  118.  
  119.     virtual ~CXYWnd();
  120.   void SetViewType(int n);
  121.   int GetViewType() {return  m_nViewType; };
  122.   void SetScale(float f) {m_fScale = f;};
  123.   float Scale() {return m_fScale;};
  124.   int Width() {return m_nWidth;}
  125.   int Height() {return m_nHeight;}
  126.   bool m_bActive;
  127.  
  128.     // Generated message map functions
  129. protected:
  130.     int m_nUpdateBits;
  131.     int m_nWidth;
  132.   int m_nHeight;
  133.   bool m_bTiming;
  134.     float    m_fScale;
  135.     float    m_TopClip;
  136.   float m_BottomClip;
  137.   bool m_bDirty;
  138.     vec3_t m_vOrigin;
  139.     CPoint m_ptCursor;
  140.   bool m_bRButtonDown;
  141.  
  142.   int    m_nButtonstate;
  143.   int m_nPressx;
  144.   int m_nPressy;
  145.   vec3_t m_vPressdelta;
  146.   bool m_bPress_selection;
  147.  
  148.   friend CCamWnd;
  149.   //friend C3DFXCamWnd;
  150.  
  151.   CMenu m_mnuDrop;
  152.   int m_nViewType;
  153.  
  154.   unsigned int m_nTimerID;
  155.   int m_nScrollFlags;
  156.   CPoint m_ptDrag;
  157.   CPoint m_ptDragAdj;
  158.   CPoint m_ptDragTotal;
  159.  
  160.     void OriginalButtonUp(UINT nFlags, CPoint point);
  161.     void OriginalButtonDown(UINT nFlags, CPoint point);
  162.   void ProduceSplits(brush_t** pFront, brush_t** pBack);
  163.   void ProduceSplitLists();
  164.   void HandleDrop();
  165.   void PaintSizeInfo(int nDim1, int nDim2, vec3_t vMinBounds, vec3_t vMaxBounds);
  166.  
  167.   void OnEntityCreate(unsigned int nID);
  168.   CPoint m_ptDown;
  169.     //{{AFX_MSG(CXYWnd)
  170.     afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  171.     afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  172.     afx_msg void OnMButtonDown(UINT nFlags, CPoint point);
  173.     afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
  174.     afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
  175.     afx_msg void OnMButtonUp(UINT nFlags, CPoint point);
  176.     afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
  177.     afx_msg void OnMouseMove(UINT nFlags, CPoint point);
  178.     afx_msg void OnPaint();
  179.     afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
  180.     afx_msg void OnSize(UINT nType, int cx, int cy);
  181.     afx_msg void OnDestroy();
  182.     afx_msg void OnSelectMouserotate();
  183.     afx_msg void OnTimer(UINT nIDEvent);
  184.     afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
  185.     afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR* lpncsp);
  186.     afx_msg void OnKillFocus(CWnd* pNewWnd);
  187.     afx_msg void OnSetFocus(CWnd* pOldWnd);
  188.     afx_msg void OnClose();
  189.     //}}AFX_MSG
  190.     DECLARE_MESSAGE_MAP()
  191. };
  192.  
  193. /////////////////////////////////////////////////////////////////////////////
  194.  
  195. //{{AFX_INSERT_LOCATION}}
  196. // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
  197.  
  198. #endif // !defined(AFX_XYWND_H__44B4BA04_781B_11D1_B53C_00AA00A410FC__INCLUDED_)
  199.